import { mapGetters, mapMutations, mapActions } from 'vuex'
// import { playMode } from 'common/js/config'
// import { shuffle } from 'common/js/until'


export const playlistMixin = {
    computed: {
        ...mapGetters([
            'playlist'
        ])
    },
    mounted() {
        this.handlePlaylist(this.playlist)
    },
    activated() {
        this.handlePlaylist(this.playlist)
    },
    watch: {
        playlist(newVal) {
            this.handlePlaylist(newVal)
        }
    },
    methods: {
        // 外部定义
        handlePlaylist() {
            throw new Error('component must implement handlePlayList method')
        }
    }
}
